import request from '@/utils/request';

export async function getUBSPosition(params) {
  return request(`/fss/Position/UBSPosition?id=${params}`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
  });
}

export async function getCurve(params) {
  return request(`/fss/netValueCurve`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
  });
}
export async function getDates(params) {
  return request(`/fss/netValueDates`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
  });
}
export async function getData(params) {
  return request(`/fss/netValueData`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(params),
  });
}
export async function getDataItem(params) {
  return request(`/fss/netValueItemData`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(params),
  });
}
export async function getStockAmend(param) {
  return request(
    param ? `/fss/ReviseStockNum/Fund2Detail?date=${param}` : `/fss/ReviseStockNum/Fund2Detail`,
    {
      method: 'GET',
      headers: {
        'Content-Type': 'application/json;charset=utf-8',
      },
    }
  );
}
export async function getOptionAmend(param) {
  return request(
    param ? `/fss/ErveryProfit/GetOptionInfo?date=${param}` : `/fss/ErveryProfit/GetOptionInfo`,
    {
      method: 'GET',
      headers: {
        'Content-Type': 'application/json;charset=utf-8',
      },
    }
  );
}
